<?php

namespace SLN0005\Controller;

use Home\Common\FIdConst;
use Home\Controller\PSIBaseController;
use Home\Service\UserService;
use SLN0005\Service\AutoVoucherService;

/**
 * 自动生成记账凭证Controller
 *
 * @author PSI
 * @copyright 2015 - present
 * @license GPL v3
 */
class AutoVoucherController extends PSIBaseController
{

  /**
   * 自动生成凭证 - 主页面
   * 
   * 模板页面：web\Application\SLN0005\View\AutoVoucher\index.html
   */
  public function index()
  {
    $us = new UserService();

    if ($us->hasPermission(FIdConst::AUTO_VOUCHER)) {
      $this->initVar();

      $this->assign("title", "自动生成记账凭证");

      $this->display();
    } else {
      $this->gotoLoginPage("/SLN0005/AutoVoucher/index");
    }
  }
}
